package com.shop.loan.model;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.*;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Setter
@Getter
@Entity
@Table(name = "s_loan_order_auth")
@Erupt(
        name = "订单审核记录",
        authVerify = false

)
public class LoanOrderAuthLog extends BaseModel {

    @Column(name = "order_id")
    private Long orderId;


    @EruptField(
            views = @View(title = "审核后订单状态"),
            edit = @Edit(
                    title = "审核后订单状态",
                    type = EditType.CHOICE,
                    search = @Search(),
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "审核中", value = "1"),
                                    @VL(label = "审核拒绝", value = "2"),
                                    @VL(label = "待签署", value = "3"),
                                    @VL(label = "待放款", value = "4"),
                                    @VL(label = "放款驳回", value = "5"),
                                    @VL(label = "待还款", value = "7"),
                                    @VL(label = "已结束", value = "10"),
                            }
                    ))
    )
    private Integer orderStatus;

    @EruptField(
            views = @View(title = "状态"),
            edit = @Edit(
                    title = "状态",
                    type = EditType.BOOLEAN,
                    notNull = true,
                    boolType = @BoolType(
                            trueText = "通过",
                            falseText = "拒绝"
                    )
            )
    )
    private Boolean authStatus;


    @EruptField(
            views = @View(title = "备注"),
            edit = @Edit(title = "备注")

    )
    private String reason;

    @EruptField(
            views = @View(title = "审核时间"),
            edit = @Edit(title = "审核时间",
                    dateType = @DateType(type = DateType.Type.DATE_TIME))
    )
    private Date createTime;

    @EruptField(
            views = @View(title = "审核人"),
            edit = @Edit(title = "审核人")
    )
    private String authBy;


}
